﻿#region Copyright (c) Lokad 2010
// This code is released under the terms of the new BSD licence.
// URL: http://www.lokad.com/
#endregion
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;

namespace Lokad.Monitoring.Rsm
{
    [DataContract(Name = "rsm")]
    public class RsmDocument
    {
        [DataMember(Name = "messages", IsRequired = false)]
        public IList<Message> Messages { get; set; }

        [DataMember(Name = "indicators", IsRequired = false)]
        public IList<Indicator> Indicators { get; set; }

        public RsmDocument()
        {
            Messages = new List<Message>();
            Indicators = new List<Indicator>();
        }
    }

    [DataContract(Name = "message")]
    public class Message
    {
        [DataMember(Name = "id")] 
        public string Id { get; set; }

        [DataMember(Name = "updated")] 
        public DateTime Updated { get; set; }

        [DataMember(Name = "title")]
        public string Title { get; set; }

        [DataMember(Name = "summary", IsRequired = false)] 
        public string Summary { get; set; }

        [DataMember(Name = "tags", IsRequired = false)] 
        public string Tags { get; set; }

        [DataMember(Name = "link", IsRequired = false)] 
        public string Link { get; set; }
    }

    [DataContract(Name = "indicator")]
    public class Indicator
    {
        [DataMember(Name = "name")] 
        public string Name { get; set; }

        [DataMember(Name = "started", IsRequired = false)]
        public DateTime Started { get; set; }

        [DataMember(Name = "updated", IsRequired = false)] 
        public DateTime Updated { get; set; }

        [DataMember(Name = "instance", IsRequired = false)]
        public string Instance { get; set; }

        [DataMember(Name = "value")] 
        public string Value { get; set; }

        [DataMember(Name = "tags", IsRequired = false)] 
        public string Tags { get; set; }

        [DataMember(Name = "link", IsRequired = false)] 
        public string Link { get; set; }
    }
}
